package me.kagami.myjvm.jvm;

import me.kagami.myjvm.jvm.opcode.*;

import java.util.HashMap;
import java.util.Map;

public class OpCodeService {
    public final static Map<Integer, OpCodeInterface> CODE_MAP = new HashMap<>();

    static {
        OpCode26iload0Handler opCode26Iload0Handler = new OpCode26iload0Handler();
        CODE_MAP.put(opCode26Iload0Handler.getOpCode(), opCode26Iload0Handler);

        OpCode27iload1Handler opCode27iload1Handler = new OpCode27iload1Handler();
        CODE_MAP.put(opCode27iload1Handler.getOpCode(), opCode27iload1Handler);

        OpCode172ireturnHandler opCode172ireturnHandler = new OpCode172ireturnHandler();
        CODE_MAP.put(opCode172ireturnHandler.getOpCode(), opCode172ireturnHandler);

        OpCode96iaddHandler opCode96iaddHandler = new OpCode96iaddHandler();
        CODE_MAP.put(opCode96iaddHandler.getOpCode(), opCode96iaddHandler);

        OpCode21iloadHandler opCode21iloadHandler = new OpCode21iloadHandler();
        CODE_MAP.put(opCode21iloadHandler.getOpCode(), opCode21iloadHandler);

    }


}
